package cn.kgc.service.impl;

/**
 * @author: 申乾航
 * @date: 2022/2/3
 * @description:
 */

import cn.kgc.dao.resumeDao;
import cn.kgc.pojo.Branch;
import cn.kgc.pojo.Resume;
import cn.kgc.pojo.position;
import cn.kgc.service.resumeService;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class resumeServiceImpl implements resumeService {

    @Resource
    private resumeDao resumeDao;


    

    @Override
    //, @Param("posId") int  posId, String workEx, @Param("resState")int resState, Date checkTime
    //,posId,workEx,resState,checkTime
    public Page<Resume> getList(String name, String posname, String workEx, String resState, String checkTime) {
       return  resumeDao.getList(name,posname,workEx,resState,checkTime);
    }

    @Override
    public Page<position> getBranchList(@Param("posName")String posName, @Param("posCode")String posCode, @Param("brName")String brName) {
        return resumeDao.getBranchList(posName,posCode,brName);
    }

    @Override
    public List<Branch> XiaLaKuangBranch() {
        return resumeDao.XiaLaKuangBranch();
    }

    @Override
    public position getPositionFen(Integer id) {
        return resumeDao.getPositionFen(id);
    }




    //@Transactional
    @Override
    public boolean tianjia(Resume resume) {
//



            if(resumeDao.tianjia(resume)>0){
                return true;
            }

//        }catch (Exception e){
//            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
//            return false;
//        }

        return false;
    }

    @Override
    public Integer selId(String posCode) {

        Integer position1 = resumeDao.selId(posCode);
        return position1;
    }


    @Override
    public Resume xiugai_cha(Integer id) {
        return resumeDao.xiugai_cha(id);
    }

    @Override
    public boolean xiugai_shen(Resume resume) {

       if (resumeDao.xiugai_shen(resume)>0){
           return true;
       }

        return false;
    }

    @Override
    public Resume chakan(Integer id) {
        return resumeDao.chakan(id);
    }

    @Override
    public int shanchu(Integer id, String resState) {
        return resumeDao.shanchu(id,resState);
    }

    @Override
    public int xiugai_03(String referrer, String recommendTime, String opinion, Integer id) {
        return resumeDao.xiugai_03(referrer,recommendTime,opinion,id);
    }

   /* @Override
    public User ming(String userCode, String userPassword) {
        return resumeDao.ming(userCode,userPassword);
    }*/

}
